package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.ReturnListDao;
import com.atguigu.jxc.dao.ReturnListGoodsDao;
import com.atguigu.jxc.entity.PurchaseVO;
import com.atguigu.jxc.entity.ReturnList;
import com.atguigu.jxc.entity.SaleList;
import com.atguigu.jxc.service.ReturnListService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author WZhaokang
 * @date 2020/12/30 0:11
 */
@Service
public class ReturnListServiceImpl implements ReturnListService {

    @Autowired
    private ReturnListDao returnListDao;
    @Autowired
    private ReturnListGoodsDao returnListGoodsDao;

    @Override
    public List<ReturnList> returnListGoodsList(String returnNumber, Integer supplierId, Integer state, String sTime, String eTime) {
        //查询退货单的列表
        return  returnListDao.returnListGoodsList(returnNumber,supplierId,state,sTime,eTime);
    }

    @Override
    @Transactional
    public void delete(Integer returnListId) {
        returnListGoodsDao.deleteByReturnListId(returnListId);
        returnListDao.deleteByReturnListId(returnListId);
    }

    @Override
    public List<PurchaseVO> count(String sTime, String eTime, Integer goodsTypeId, String codeOrName) {
        return returnListDao.count(sTime,eTime,goodsTypeId,codeOrName);
    }
}
